Advanced video compression formats such as H.264 provide many different modes to encode macroblocks and the blocks within the macroblocks. Specifically, a conventional encoder decides if the macroblock/block should be encoded using inter prediction or intra prediction.
If intra prediction is selected, the encoder also chooses a particular block size to process. The common intra prediction block sizes are 4×4, 8×8 and 16×16. For each block, the encoder also chooses a particular direction along which to predict. The common intra prediction directions are vertical, horizontal, DC (i.e., no direction), diagonal down left, diagonal down right, vertical right, horizontal down, vertical left and horizontal up.
If inter prediction is selected, the encoder will determine if the macroblock should be encoded as a direct block or an inter block. If inter-block prediction is selected, the encoder determines one or two reference frames and a particular block size to process. Common inter prediction block sizes are 4×4, 4×8, 8×4, 8×8, 16×8, 8×16 and 16×16. Each reference frame used in the inter prediction is an actual frame or an interpolated version of an actual frame.
To achieve high compression efficiency, some encoders use a common Rate-Distortion Optimization (RDO) analysis. A best mode of at least two encoding modes is selected under RDO by computing, for each of the modes, (i) a measure of distortion that would result in a decoded picture using the mode, (ii) a measure of the number of bits (i.e., rate) that would be generated using the mode and (iii) a combined score based on the rate and the distortion. Typically, the combined score is a weighted sum of the rate and the distortion. The best mode is selected as the mode with the lowest score.
Referring to FIG. 1, a partial block diagram of a conventional RDO-based encoder 10 is shown. Blocks of original samples are received in a signal ORG. The RDO repeats the encoding process for the blocks in two or more modes to determine the best mode. The RDO adds a bit count 12 and an error measurement 14 to the conventional encoding process to evaluate the rate and the distortion. The bit count 12 counts the number of bits in an entropy encoded bitstream. The error measurement 14 calculates errors between the original samples in the signal ORG and reconstructed samples in a signal REC. The reconstructed samples are based on inverse transform samples calculated by an inverse transform circuit 16. The RDO analysis improves encoder efficiency to achieve a high quality decoded video sequence at a low bit rate. However, the RDO analysis involves many computations for each mode. Therefore, an encoder that employs RDO will be expensive and/or consume significant power.
It is desirable to have an encoder with the compression benefits of RDO at a lower expense.